<?php
$dis_id=3;
include("../../inc/conn.inc");
include("../islogin.php");
if($_POST['act_xg']&&$_POST[picture]&&$_POST[i_title]){

    @mysql_query("insert into jm_img (jm_id,member_id,picture,img_title) values ('$_POST[iid]','".$_COOKIE['user_id']."','$_POST[picture]','$_POST[i_title]')");
    
	@mysql_query("update jm_img set picture='$_POST[picture]',img_title='$_POST[i_title]' where id='".$_POST['iid']."'");
	echo "<script>location='".$_POST['urls']."';</script>";
	
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 代理加盟 &gt;&gt; 发布代理加盟</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">发布代理加盟信息</TD>
   </TR>
</TABLE>
<br>
<?php 
   $rs=@mysql_query("select * from jm_img where id='".$_GET['xg_id']."' and member_id='".$_COOKIE['user_id']."'");
   $row=@mysql_fetch_array($rs);
?>
<TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
        <TBODY>
        <form method="post" action="" name="form1" onSubmit="return checkform()">
		  <tr>
		     <td height="40" colspan="2" align="center" bgcolor="#EFF6FF">&nbsp;</td>
		  </tr>
          <TR>
            <td width="17%" height="100" align="center" bgcolor="#EFF6FF">图片&nbsp;<font color="#FF0000">*</font></td>
            <TD width="83%" bgcolor="#F9F9F9" style="padding:4px;line-height:30px;"><?php if($row[picture]){?><img src="http://img.sandib2b.cn/<?=$row[picture]?>" width="140" height="104" border="0" /><br /><?php }?><input name="picture" id="picture" type="text" size="35" maxlength="100" value="<?=$row[picture]?>">&nbsp;&nbsp;<input name="button" type="button" onClick="window.open ('../upfile.php', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')" value="上传图片">
              (建议图片长宽：270*240)<br>
            <input type="button" onClick="window.open ('/member/photo/info.php', 'newwindow', 'height=500, width=600, top=0, left=250, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no')" value="选择已上传的图片"></TD>
          </TR>			  		  		  
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">图片标题&nbsp;<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="i_title" id="i_title" value="<?=$row[img_title]?>" type="text" size="20" maxlength="8">
            (限制8个汉字)</TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">&nbsp;</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input type="submit" value="提交">
           <INPUT type="hidden" value="ok" name="act_xg">
		    <input type="hidden" name="urls" value="<?=$_SERVER['HTTP_REFERER']?>">
			<input type="hidden"  name="iid" value="<?=$row['id']?>">
			</TD>
          </TR>
 </form>                
</TABLE>

</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>

</div>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
   if($("picture").value==""){
      alert("请选择您要上传的图片");
      $("picture").focus();
      return false;
   }
   if($("i_title").value==""){
      alert("图片标题不能为空");
      $("i_title").focus();
      return false;
   }
}
</script>